package com.yonyou.openapi.service;

import com.yonyou.openapi.base.auth.token.OpenApiTokenCacheProvider;
import com.yonyou.openapi.base.datacenter.impl.DataCenterUrlProviderImpl;
import com.yonyou.openapi.base.datacenter.pojo.GatewayAddressResponse;
import com.yonyou.openapi.base.response.OpenApiAccessToken;
import lombok.extern.slf4j.Slf4j;


/**
 * @author nishch
 * @description: TODO
 * @date 2022/3/8
 */
@Slf4j
public class TokenProviderImpl extends DataCenterUrlProviderImpl implements OpenApiTokenCacheProvider {

    /**
     * TODO：不建议每次都调用接口，建议将租户地址对应关系持久化到数据库和缓存中
     * @return GatewayAddressResponse.GatewayAddressDTO
     */
    @Override
    public GatewayAddressResponse.GatewayAddressDTO queryGatewayAddress() {
        return super.queryGatewayAddress();
    }

    /**
     *  TODO: 从缓存中获取token
     * @return token对象
     */
    @Override
    public OpenApiAccessToken loadTokenFromCache() {
        return null;
    }

    /**
     *  TODO：建议对token进行缓存处理
     * @param token token实体
     */
    @Override
    public void saveTokenToCache(OpenApiAccessToken token) {

    }

}
